home *** CD-ROM | disk | FTP | other *** search
- Path: chaos.kulnet.kuleuven.ac.be!usenet
- From: Andreas De Troy <andreas.de.troy%psl%pedcc3.kuleuven.ac.be>
- Newsgroups: comp.lang.c
- Subject: Re: c
- Date: 25 Jan 1996 10:23:12 GMT
- Organization: KUL
- Message-ID: <4e7lmg$ghh@chaos.kulnet.kuleuven.ac.be>
- NNTP-Posting-Host: pcip194.psy.kuleuven.ac.be
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
-
- news:822503385snz@genesis.demon.co.uk
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- >In article <1996Jan24.144108.23883@river.tay.ac.uk>
- > insc2mb@river.tay.ac.uk "Mr persil" writes:
- >
- >>I wonder if anyone can help. I have written a program to add an word to the
- >>end of a text file. This text file was created using msdos editor. The c
- >>compiler is borland. I try using the a and a+ modes to append to the end
- >>of the file. I used fprintf(text,word); but this doesn't seem to add the
- >>word to the file.
- >
- I sent a mail yesterday about this, but it does not seem to come through.
-
- The problem could be that your editor adds an "end-of-file"-marker at the
- end of its file (ASCII-code 26 or 27 [Ctrl-Z], I don't know). The
- fprintf()-function adds its characters AFTER this eof-marker.
-
- When you load the file in your editor, it stops reading input when it
- encounters this eof-marker, so it will not let you see what comes after
- it. A binary dump should reveal, however, that the appended words are
- really there.
-
- Solutions:
- 1. try another editor; some do *not* append this eof-mark
- 2. keep your ASCII-file clean", i.e. do not save it with your editor. The
- Borland-functions will not append eof-marks, so as long as your file is
- exclusively produced by these functions, everything should work fine.
-
-